<?php namespace App;

use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;

/**
 * App\Profession
 *
 * @property int $id id
 * @property int $pid
 * @property string|null $pro_name 职业
 * @property string|null $deleted_at
 * @property \Carbon\Carbon|null $created_at
 * @property \Carbon\Carbon|null $updated_at
 * @method static bool|null forceDelete()
 * @method static \Illuminate\Database\Query\Builder|\App\Profession onlyTrashed()
 * @method static bool|null restore()
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Profession whereCreatedAt($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Profession whereDeletedAt($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Profession whereId($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Profession wherePid($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Profession whereProName($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Profession whereUpdatedAt($value)
 * @method static \Illuminate\Database\Query\Builder|\App\Profession withTrashed()
 * @method static \Illuminate\Database\Query\Builder|\App\Profession withoutTrashed()
 * @mixin \Eloquent
 * @property-read \Illuminate\Database\Eloquent\Collection|\App\Profession[] $childPro
 * @property-read \App\Profession $parentPro
 */
class Profession extends Model
{
    protected $table = 'profession';
    use SoftDeletes;

    /**
     * @return \Illuminate\Database\Eloquent\Relations\HasMany
     */
    public function childPro(){
        return $this->hasMany('App\Profession','pid');
    }

    /**
     * @return \Illuminate\Database\Eloquent\Relations\BelongsTo
     */
    public function parentPro(){
        return $this->belongsTo('App\Profession','pid');
    }
}